using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter42
{
	/// <summary>
	/// Example02: Electronic Transitions in Hydrogen
	/// (A)	
	/// The electron in a hydrogen atom makes a transition 
	/// from the n = 2 energy level to the ground level (n = 1). 
	/// Find the wavelength and frequency of the emitted photon.
	/// (B)	
	/// In interstellar space, highly excited hydrogen atoms 
	/// called Rydberg atoms have been observed. Find the 
	/// wavelength to which radio astronomers must tune to 
	/// detect signals from electrons dropping 
	/// from the n = 273 level to n = 272. 
	/// (C)	
	/// What is the radius of the electron orbit for 
	/// a Rydberg atom for which n = 273? 
	/// (D)	
	/// How fast is the electron moving in a Rydberg atom 
	/// for which n = 273?
	/// </summary>
	public class Example02
	{
		public Example02()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Hydrogen H = new L.Hydrogen();
			//(A)
			H.TransitonFrom = 2;
			H.TransitonTo = 1;
			L.Photon gamma = H.EmitPhoton();
			result+=Convert.ToString(gamma.Wavelength)+"   ";
			result+=Convert.ToString(gamma.Frequency)+"\r\n";
			//(B)
			H.TransitonFrom = 273;
			H.TransitonTo = 272;
			L.Photon gamma2 = H.EmitPhoton();
			result+=Convert.ToString(gamma2.Wavelength)+"   ";
			result+=Convert.ToString(gamma2.Frequency)+"\r\n";
			//(C)
			H.PrincipalQuantumNumber = 273;
			result+=Convert.ToString(H.HydrogenRadiusNanoMeter)+"\r\n";
		}
	}
}
